Get Master Locations
/locations
As a Customer of iFoodDS, you can use the Get Master Locations API to query master locations from the iFoodDS Trace Exchange platform.
This endpoint is being refined and thus subject to change. These docs will update when changes are made.
Request
Type: application/json
Retrieving master locations via the API is done through paging. The request requires a series of query parameters which define the page that must be returned. These parameters must be supplied in the url when the get is executed in order to return the result set for the page being queried.
Query Parameters
Optional
page(number): The page index of the locations to return. The first page is index 0.size(number): The number of results to return per page. Default value is 20.id(UUID, repeatable): Matches any specified DII location ID (diiId).gln(string, repeatable): Matches any specifiedglnvalue (IN match).duns(string, repeatable): Matches any specifieddunsvalue (IN match).locationCode(string, repeatable): Matches any specified resolved location code: the vendor code when set, otherwise the data-provider code.alternateLocationId(string, repeatable): Matches any specifiedalternateLocationIdvalue (IN match).parentLocationId(string, repeatable): Matches any specifiedparentLocationIdvalue (IN match).locationName(string, repeatable): Matches any specified resolved location name: the vendor name when set, otherwise the data-provider name.locationType(string, repeatable): Matches the stored location type case-insensitively.businessUnit(string, repeatable): Matches any specifiedbusinessUnitvalue (IN match).category(string, repeatable): Filters byLocationCategory. Accepts a display label (for example,Grocery Store) or an enum name (for example,RESTAURANT).country(string, repeatable): Matches any specifiedcountryvalue (IN match).state(string, repeatable): Matches any specifiedstatevalue (IN match).city(string, repeatable): Matches any specifiedcityvalue (IN match).postalCode(string, repeatable): Matches any specifiedpostalCodevalue (IN match).isCoveredByGdst(boolean): Filters by equality onisCoveredByGdst(trueorfalse).isPrimaryLocation(boolean): Filters by equality onisPrimaryLocation(trueorfalse).glnAssignedBy(string, repeatable): Matches any specifiedglnAssignedByvalue (IN match).submitStartDateTime(ISO local datetime): Includes only locations whosedateModifiedis on or after the specified date and time (inclusive).submitEndDateTime(ISO local datetime): Includes only locations whosedateModifiedis on or before the specified date and time (inclusive).
Repeatable Filters
For filters marked repeatable, supply multiple values as a comma-separated list or repeat the query parameter. For example, id=<uuid1>,<uuid2> or id=<uuid1>&id=<uuid2>. IN matching returns records matching any supplied value for that filter.
Data Constraints
submitStartDateTimeandsubmitEndDateTimeuse ISO local datetime values in the formatyyyy-MM-ddTHH:mm:ss(for example,2026-09-28T14:30:00).- Both date filters apply to
dateModified, and both boundaries are inclusive. - Boolean filters accept
trueorfalse.
Response
- 200
- 400
Return result for the master locations queried.
{
"content": [
{
"id": "<location id>",
"gln": "<global location number>",
"city": "<city>",
"duns": "<duns number>",
"state": "<state>",
"country": "<country>",
"geoFence": "<geo fence coordinates>",
"postalCode": "<postal code>",
"phoneNumber": "<phone number>",
"businessUnit": "<business unit>",
"locationCode": "<location code>",
"locationName": "<location name>",
"locationType": "<location type>",
"glnAssignedBy": "<gln assigned by>",
"gpsCoordinates": "<gps coordinates>",
"streetAddress1": "<street address 1>",
"streetAddress2": "<street address 2>",
"isCoveredByGdst": <is covered by gdst>,
"parentLocationId": "<parent location id>",
"isPrimaryLocation": <is primary location>,
"alternateLocationId": "<alternate location id>"
}
],
"pageable": {
"pageNumber": <page number>,
"pageSize": <page size>,
"sort": {
"unsorted": <is unsorted>,
"sorted": <is sorted>,
"empty": <is page empty>
},
"offset": <offset size>,
"unpaged": <is unpaged>,
"paged": <is paged>
},
"totalPages": <total pages>,
"totalElements": <total elements>,
"last": <is last page>,
"numberOfElements": <number of elements>,
"size": <page size>,
"number": <page number>,
"sort": {
"unsorted": <is unsorted>,
"sorted": <is sorted>,
"empty": <is empty>
},
"first": <is first page>,
"empty": <is page empty>
}
Content
id(uuid): The unique identifier for the locationgln(string): GS1 Global Location Number, a 13-digit string. GS1 GTIN Executive Summarycity(string): The city where the location is situatedduns(string): Data Universal Numbering System identifierstate(string): The state or province where the location is situatedcountry(string): The country where the location is situatedgeoFence(string): A series of GPS coordinates that define the boundaries of the locationpostalCode(string): The postal or ZIP code for the locationphoneNumber(string): Contact phone number for the locationbusinessUnit(string): The business unit associated with this locationlocationCode(string): A unique code identifier for the locationlocationName(string): The name of the locationlocationType(string): The type of locationglnAssignedBy(string): The organization that assigned the GLNgpsCoordinates(string): The GPS coordinates for the locationstreetAddress1(string): The primary street addressstreetAddress2(string): Additional address information (e.g., suite number)isCoveredByGdst(boolean): Indicate if the location is part of GDSTparentLocationId(string): Identifier for the parent location, if this is a child locationisPrimaryLocation(boolean): Indicates if this is the primary locationalternateLocationId(string): Alternate ID of the location
Pageable
pageable(object)pageNumber(number): The current page number in the page series. Index 0 is first pagepageSize(number): The number of events contained in the pageoffset(number): If there is an offset specified on there return results this will be populates. Default is 0unpaged(boolean): If the record set is unpaged then true else falsepaged(boolean): If the record set is paged then true else falsesort(object)unsorted(boolean): If the record set is unsorted then true else falsesorted(boolean): If the record set is sorted then true else falseempty(boolean): If the record set is empty then true else false
totalPages(number): The total amount of pages that contain all events in the querytotalElements(number): The total amount of events in the querylast(boolean): If the page is the last in the series then true else falsenumberOfElements(number): The total amount of events in the tablesize(number): The number of events contained in the pagenumber(number): The current page number in the page seriessort(object)unsorted(boolean): If the record set is unsorted then true else falsesorted(boolean): If the record set is sorted then true else falseempty(boolean): If the record set is empty then true else false
first(boolean): If the page is the first in the series then true else falseempty(boolean): If the page is empty then true else false
Sample Response
{
"content": [
{
"id": "d96583b3-8cf9-43bb-9db3-02f060bb4a53",
"gln": "1234567890123",
"city": "Springfield",
"duns": "123456789",
"state": "IL",
"country": "US",
"geoFence": "40.28,-84.15,40.29,-84.14,40.27,-84.14",
"postalCode": "62701",
"phoneNumber": "+1-800-555-0199",
"businessUnit": null,
"locationCode": "CDC001",
"locationName": "Central Distribution Center",
"locationType": "Internal",
"glnAssignedBy": "GS1",
"gpsCoordinates": "86.271142,-79.593557",
"streetAddress1": "123 Main St",
"streetAddress2": "Suite 100",
"isCoveredByGdst": false,
"parentLocationId": "HQ001",
"isPrimaryLocation": true,
"alternateLocationId": null
}
],
"pageable": {
"pageNumber": 0,
"pageSize": 20,
"sort": {
"unsorted": true,
"sorted": false,
"empty": true
},
"offset": 0,
"unpaged": false,
"paged": true
},
"totalPages": 22,
"totalElements": 440,
"last": false,
"numberOfElements": 20,
"size": 20,
"number": 0,
"sort": {
"unsorted": true,
"sorted": false,
"empty": true
},
"first": true,
"empty": false
}
Description of what user-fixable validation error occurred and in what part of the payload
{
"timestamp": "2024-12-08T20:47:54.096+00:00",
"status": 400,
"error": "Bad Request",
"message": "<error description>"
}